package org.wlw.service.impl;

import org.wlw.anno.Resource;
import org.wlw.dao.IStudentDao;
import org.wlw.dao.IUserDao;
import org.wlw.models.User;
import org.wlw.service.IUserService;

public class UserService extends BaseService implements IUserService {
    private IUserDao userDao;
    private IStudentDao studentDao;

    //如果要为这个注解添加两个值，需要分别写键和值的关系
//    @Resource(value="test",num="123") //此时的test是给注解中的value这个值
    @Resource
    public void setUserDao(IUserDao userDao) {
        this.userDao = userDao;
    }

    @Resource("stuDao")
    public void setStudentDao(IStudentDao studentDao) {
        this.studentDao = studentDao;
    }

    public void setAAA() {

    }

    @Override
    public void add(User user) {
        userDao.add(user);
        studentDao.add("aaaa");
    }
}
